package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.domain.db.BlackList;
import com.tanhua.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户持久层接口
 */
public interface BlackListMapper extends BaseMapper<BlackList> {
    /**
     * 自定义分页查询（mybatis plus拦截 查询分页数据封装返回IPage）
     * @param queryPage
     * @param userId
     * @return
     */
    @Select("select tui.* from tb_user_info tui,tb_black_list tbl where tui.id = tbl.black_user_id " +
            "and tbl.user_id = #{userId}")
    IPage<UserInfo> findPageBlackList(Page<UserInfo> queryPage, @Param("userId") Long userId);
}
